package com.example.demo.utils;

import com.example.demo.domain.Girl;
import com.example.demo.domain.Result;

/**
 * Created by wangbing on 2018/3/29.
 */
public class ResultUtils {
    public static Result success(Object object){
        Result<Girl> result = new Result<>();
        result.setCode(1);
        result.setMsg("成功");
        result.setData((Girl) object);
        return result;
    }
    public static Result success(){

        return success(null);
    }


    public static Result error(Integer code,String msg){
        Result<Girl> result = new Result<>();
        result.setCode(code);
        result.setMsg(msg);
        result.setData(null);
        return result;
    }
}
